import request from '@/utils/request'

var url = process.env.VUE_APP_SUM_PUB;


// 新增数据库配置
export function Add(data) {
  return request({
    url: '/games',
    method: 'post',
    data: data
  })
}

// 修改数据库配置
export function Update(data) {
  return request({
    url: '/games/' + data.id,
    method: 'put',
    data: data
  })
}

// 查询数据库配置列表
export function getList(query) {
  return request({
    url: '/games',
    method: 'get',
    params: query
  })
}
// 查询数据库配置详细
export function Show(id) {
  return request({
    url: '/games/' + id,
    method: 'get'
  })
}

// 删除数据库配置
export function Delete(id) {
  return request({
    url: '/games/' + id,
    method: 'delete'
  })
}



//正式切换
export function Cut(id) {
  return request({
    url: '/games/cut/' + id,
    method: 'get'
  })
}


//查询游戏列表
export function getGamesList(id) {
  return request({
    url: '/games/list/' + id,
    method: 'get'
  })
}

//首包，微端文件上传-前步骤
export function GameResource(data) {
  return request({
    url: url + '/upload/oss-direct/game-resource',
    method: 'post',
    data: data
  })
}
